#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

void setRed();
void setGreen();
void setBlue();
void setYellow();
void setOrange();

int main() {
    int choice;
    printf("1.Red\n");
    printf("2.Green\n");
    printf("3.Blue\n");
    printf("4.Yellow\n");
    printf("5.Orange\n");
    printf("6.Goodbye!\n");
    printf("Please Input choose(1-6): ");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
        setRed();
        break;
    case 2:
        setGreen();
        break;
    case 3:
        setBlue();
        break;
    case 4:
        setYellow();
        break;
    case 5:
        setOrange();
        break;
    case 6:
        printf("Goodbye!\n");
        return 0;
    default:
        printf("Invalid choice. Try again.\n");
        break;
    }
    return 0;
}

void setRed() {
    int subChoice;
    printf("Red submenu:\n");
    printf("1. Red apple\n");
    printf("2. Red tomato\n");
    printf("3. Red cherry\n");
    printf("4. return mainmenu\n");
    printf("Please Input choose(1-4): ");
    scanf("%d", &subChoice);
    switch (subChoice) {
    case 1:
        printf("I like it!\n");
        setRed();
        break;
    case 2:
        printf("I like it very much!\n");
        setRed();
        break;
    case 3:
        printf("I don't like it!\n");
        setRed();
        break;
    case 4:
        return;
    default:
        printf("Invalid choice. Try again.\n");
        setRed();
        break;
    }
}

void setGreen() {
    printf("Green color set.\n");
}

void setBlue() {
    printf("Blue color set.\n");
}

void setYellow() {
    printf("Yellow color set.\n");
}

void setOrange() {
    printf("Orange color set.\n");
}